from flask import Flask, request, make_response

app = Flask(__name__)


@app.route('/')
def index():
    #useragent = request.headers.get('user-agent')
    rsp = make_response('<h1>cookie</h1>')
    rsp.set_cookie('username','luofan')
    return rsp
    #return f'hello {useragent}'

@app.route('/user/<name>')
def hello(name):
    return f'hello {name}'

if __name__ == '__main__':
    app.run(debug=True)